<style>
    .welcome .layui-card {border:1px solid #f2f2f2;border-radius:5px;}
    .welcome .icon {margin-right:10px;color:#1aa094;}
    .welcome .icon-cray {color:#ffb800 !important;}
    .welcome .icon-blue {color:#1e9fff !important;}
    .welcome .icon-tip {color:#ff5722 !important;}
    .welcome .layuimini-qiuck-module {text-align:center;margin-top:10px}
    .welcome .layuimini-qiuck-module a i {display:inline-block;width:100%;height:60px;line-height:60px;text-align:center;border-radius:2px;font-size:30px;background-color:#F8F8F8;color:#333;transition:all .3s;-webkit-transition:all .3s;}
    .welcome .layuimini-qiuck-module a cite {position:relative;top:2px;display:block;color:#666;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:14px;}
    .welcome .welcome-module {width:100%;height:210px;}
    .welcome .panel {background-color:#fff;border:1px solid transparent;border-radius:3px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}
    .welcome .panel-body {padding:10px}
    .welcome .panel-title {margin-top:0;margin-bottom:0;font-size:12px;color:inherit}
    .welcome .label {display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;margin-top:.3em;}
    .welcome .layui-red {color:red}
    .welcome .main_btn > p {height:40px;}
    .welcome .layui-bg-number {background-color:#F8F8F8;}
    .welcome .layuimini-notice:hover {background:#f6f6f6;}
    .welcome .layuimini-notice {padding:7px 16px;clear:both;font-size:12px !important;cursor:pointer;position:relative;transition:background 0.2s ease-in-out;}
    .welcome .layuimini-notice-title,.layuimini-notice-label {padding-right:70px !important;text-overflow:ellipsis !important;overflow:hidden !important;white-space:nowrap !important;}
    .welcome .layuimini-notice-title {line-height:28px;font-size:14px;}
    .welcome .layuimini-notice-extra {position:absolute;top:50%;margin-top:-8px;right:16px;display:inline-block;height:16px;color:#999;}
</style>
<html xmlns:th="http://www.thymeleaf.org">
<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main welcome">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md8">
                <div class="layui-row layui-col-space15">
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-warning icon"></i>数据统计</div>
                            <div class="layui-card-body">
                                <div class="welcome-module">
                                    <div class="layui-row layui-col-space10">
                                        <div class="layui-col-xs6">
                                            <div class="panel layui-bg-number">
                                                <div class="panel-body">
                                                    <div class="panel-title">
                                                        <span class="label pull-right layui-bg-blue">实时</span>
                                                        <h5>收录图书</h5>
                                                    </div>
                                                    <div class="panel-content">
                                                        <h1 class="no-margins" th:text="${bookNum}">50</h1>
                                                        <small>当前已录入图书总数</small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <div class="panel layui-bg-number">
                                                <div class="panel-body">
                                                    <div class="panel-title">
                                                        <span class="label pull-right layui-bg-cyan">实时</span>
                                                        <h5>用户统计</h5>
                                                    </div>
                                                    <div class="panel-content">
                                                        <h1 class="no-margins" th:text="${borrowerNum}">16</h1>
                                                        <small>当前已注册用户总数</small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <div class="panel layui-bg-number">
                                                <div class="panel-body">
                                                    <div class="panel-title">
                                                        <span class="label pull-right layui-bg-orange">实时</span>
                                                        <h5>借出总数</h5>
                                                    </div>
                                                    <div class="panel-content">
                                                        <h1 class="no-margins" th:text="${borrowNum}">10</h1>
                                                        <small>当前累计借出总数</small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <div class="panel layui-bg-number">
                                                <div class="panel-body">
                                                    <div class="panel-title">
                                                        <span class="label pull-right layui-bg-green">实时</span>
                                                        <h5>书评总数</h5>
                                                    </div>
                                                    <div class="panel-content">
                                                        <h1 class="no-margins" th:text="${commentNum}">1234</h1>
                                                        <small>当前已有书评总数</small>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <div class="layui-card">
                            <div class="layui-card-header"><i class="fa fa-credit-card icon icon-blue"></i>快捷入口</div>
                            <div class="layui-card-body">
                                <div class="welcome-module">
                                    <div class="layui-row layui-col-space10 layuimini-qiuck">
                                        <div class="layui-col-xs4 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/visitorBookShow" data-title="图书查看" data-icon="fa fa-gears">
                                                <i class="fa fa-gears"></i>
                                                <cite>图书查看</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs4 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/visitorBookSearch" data-title="图书搜索" data-icon="fa fa-file-text">
                                                <i class="fa fa-file-text"></i>
                                                <cite>图书搜索</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs4 layuimini-qiuck-module">
                                            <a href="javascript:;" layuimini-content-href="/visitorBookRank" data-title="图书排行" data-icon="fa fa-calendar">
                                                <i class="fa fa-calendar"></i>
                                                <cite>图书排行</cite>
                                            </a>
                                        </div>
                                        <div class="layui-col-xs4 layuimini-qiuck-module">
                                            <a href="javascript:;" onclick="window.location.href='../index.html'" data-title="返回登录" data-icon="fa fa-hourglass-end">
                                                <i class="fa fa-hourglass-end"></i>
                                                <cite>返回登录</cite>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
<!--                    <div class="layui-col-md12">-->
<!--                        <div class="layui-card">-->
<!--                            <div class="layui-card-header"><i class="fa fa-line-chart icon"></i>报表统计</div>-->
<!--                            <div class="layui-card-body">-->
<!--                                <div id="echarts-records" style=" width: 100%;min-height:500px"></div>-->
<!--                            </div>-->
<!--                        </div>-->
<!--                    </div>-->
                </div>
            </div>

            <div class="layui-col-md4">

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-bullhorn icon icon-tip"></i>开发日志</div>
                    <div class="layui-card-body layui-text">
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">完善整体功能</div>
                            <div class="layuimini-notice-extra">2021-06-30 01:10</div>
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">修复因修复BUG而产生的新BUG</div>
                            <div class="layuimini-notice-extra">2021-06-29 12:57</div>
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">修复已有BUG</div>
                            <div class="layuimini-notice-extra">2021-06-28 14:28</div>
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">完善游客端功能</div>
                            <div class="layuimini-notice-extra">2021-06-27 11:02</div>
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">新增游客端图书查看</div>
                            <div class="layuimini-notice-extra">2021-06-22 11:55</div>
                        </div>
                        <div class="layuimini-notice">
                            <div class="layuimini-notice-title">修复前端页面逻辑</div>
                            <div class="layuimini-notice-extra">2021-06-10 14:53</div>
                        </div>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-fire icon"></i>版本信息</div>
                    <div class="layui-card-body layui-text">
                        <table class="layui-table">
                            <colgroup>
                                <col width="100">
                                <col>
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>系统名称</td>
                                <td>
                                    图书管理系统
                                </td>
                            </tr>
                            <tr>
                                <td>当前版本</td>
                                <td>v2.0.0</td>
                            </tr>
                            <tr>
                                <td>主要特色</td>
                                <td>零门槛 / 响应式 / 清爽 / 极简</td>
                            </tr>
                            <tr>
                                <td>Gitee</td>
                                <td style="padding-bottom: 0;">
                                    <div class="layui-btn-container">
                                        <a href="https://gitee.com/shuo2000/librarySystem" target="_blank" style="margin-right: 15px"><img src="https://gitee.com/shuo2000/librarySystem/badge/star.svg?theme=dark" alt="star"></a>
                                        <a href="https://gitee.com/shuo2000/librarySystem" target="_blank"><img src="https://gitee.com/shuo2000/librarySystem/badge/fork.svg?theme=dark" alt="fork"></a>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="layui-card">
                    <div class="layui-card-header"><i class="fa fa-paper-plane-o icon"></i>系统日志</div>
                    <div class="layui-card-body layui-text layadmin-text">
                        <p>本系统基于layui2.5.4+springboot2.0+mybatis+mysql实现。</p>
                        <p>layui开发文档地址：<a class="layui-btn layui-btn-xs layui-btn-danger" target="_blank" href="http://www.layui.com/doc">layui文档</a></p>
                        <p>springboot官方文档地址：<a class="layui-btn layui-btn-xs layui-btn-danger" target="_blank" href="https://spring.io/projects/spring-boot">springboot文档</a></p>
                        <p>mybatis官方文档地址：<a class="layui-btn layui-btn-xs layui-btn-danger" target="_blank" href="http://www.mybatis.cn/archives/789.html">mybatis文档</a></p>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['layer','echarts'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            echarts = layui.echarts;


        /**
         * 报表功能
         */
        var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
        var optionRecords = {
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b}: {c} ({d}%)'
            },
            legend: {
                data: ['学生信息', '综合评价', '档案管理', '学习档案', '运动档案', '实践档案', '健康档案']
            },
            series: [
                {
                    name: '当前系统',
                    type: 'pie',
                    selectedMode: 'single',
                    radius: [0, '30%'],
                    label: {
                        position: 'inner',
                        fontSize: 14,
                    },
                    labelLine: {
                        show: false
                    },
                    data: [
                        {value: 50, name: '档案管理'},
                        {value: 16, name: '学生信息'},
                        {value: 10, name: '综合评价', selected: true}
                    ]
                },
                {
                    name: '档案来源',
                    type: 'pie',
                    radius: ['45%', '60%'],
                    labelLine: {
                        length: 30,
                    },
                    label: {
                        formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                        backgroundColor: '#F6F8FC',
                        borderColor: '#8C8D8E',
                        borderWidth: 1,
                        borderRadius: 4,

                        rich: {
                            a: {
                                color: '#6E7079',
                                lineHeight: 22,
                                align: 'center'
                            },
                            hr: {
                                borderColor: '#8C8D8E',
                                width: '100%',
                                borderWidth: 1,
                                height: 0
                            },
                            b: {
                                color: '#4C5058',
                                fontSize: 14,
                                fontWeight: 'bold',
                                lineHeight: 33
                            },
                            per: {
                                color: '#fff',
                                backgroundColor: '#4C5058',
                                padding: [3, 4],
                                borderRadius: 4
                            }
                        }
                    },
                    data: [
                        {value: 36, name: '学习档案'},
                        {value: 7, name: '运动档案'},
                        {value: 4, name: '实践档案'},
                        {value: 3, name: '健康档案'},
                    ]
                }
            ]
        };
        echartsRecords.setOption(optionRecords);
        // echarts 窗口缩放自适应
        window.onresize = function () {
            echartsRecords.resize();
        }

    });
</script>
